﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Kingdee.BOS;
using Kingdee.BOS.Util;
using Kingdee.BOS.Core.Report.PlugIn;
using Kingdee.BOS.Core.Report.PlugIn.Args;
using System.ComponentModel;
using System.Data;

namespace PoorderBillFXMX
{
    [Kingdee.BOS.Util.HotUpdate]
    [Description("采购统计分析明细表单插件")]
    public class MXFedit : AbstractSysReportPlugIn
    {
        public override void FormatCellValue(FormatCellValueArgs args)
        {
            base.FormatCellValue(args);

            if (args.Header.ColType == Kingdee.BOS.SqlStorageType.SqlDecimal)
            {
                decimal value = decimal.Parse(args.FormateValue);
                //decimal afterValue = decimal.Round(value, 2, MidpointRounding.ToEven);
                string afterValue = value.ToString("N");
                args.FormateValue = afterValue;
            }


            if (args.CellType == Kingdee.BOS.Core.Enums.BOSEnums.Enu_ReportCellType.Total)
            {// 格式化合计行
                if (args.Header.Key.EqualsIgnoreCase("FSupName"))
                {
                    args.FormateValue = "合计";
                }
            }
        }
    }
}
